package com.jlcindia;

public class OOPTest32 {

	public static void main(String[] args) {
		Hai ref1=new Hai('A',1234.48,99,"JLC");
		Hai ref2=new Hai('B',4512.25,88,"SD");
		System.out.println("\n Using ref1");
		System.out.println(ref1.data);
		System.out.println(ref1.getHellodata());
		System.out.println(ref1.getAbcdata());
		System.out.println("\n Using ref2");
		System.out.println(ref2.data);
		System.out.println(ref2.getHellodata());
		System.out.println(ref2.getAbcdata());
		System.out.println("==================");
		ref1.show(true);
		ref2.show(false);

	}

}
class Abc1{
	double data;
	Abc1(){}
	Abc1(double data){
		this.data=data;
	}
	double getAbcdata(){
		return this.data;
	}
}
class Hello extends Abc1{
	int data=10;
	String msg="Welcome";
	int getHellodata(){
		return this.data;
	}
	Hello(){}
	Hello(double val,int data,String msg){
		super(val);
		this.data=data;
		this.msg=msg;
	}
}
class Hai extends Hello{
	char data;
	Hai(){
		super();
	}
	Hai(char ch,double dval,int val,String msg){
		super(dval,val,msg);
		this.data=ch;
	}
	void show(boolean data){
		System.out.println("\n show() in Hai class");
		System.out.println(data);
		System.out.println(this.data);
		System.out.println(msg);
		Hello h=new Hello();
		System.out.println("h.data :"+h.data);
		System.out.println("h.msg  :"+h.msg);
		Abc1 r1=new Abc1();
		System.out.println("r1.data :"+r1.data);
		System.out.println("super.data :"+super.data);
		System.out.println(this);
		//System.out.println(super);
		System.out.println(getHellodata());
		System.out.println(this.getHellodata());
		System.out.println(super.getHellodata());
		System.out.println(getAbcdata());
	}
}